CXXFLAGS = -g -Wall -Wno-deprecated -fexceptions
CXXFLAGS += -I/usr/include/llvm-2.8/include
CXXFLAGS += `llvm-config --cxxflags`
LDFLAGS = `llvm-config --ldflags`
LDFLAGS += -L/usr/lib
LDLIBS = `llvm-config --libs asmparser bitreader ipa`

CC = g++
CXX = g++
LD = g++

all : main

main = main.cpp constraint_parser.cpp analyzer.cpp disjoint_set.cpp dfs.cpp

main : $(patsubst %.cpp,%.o,$(main))
-include *.d                                                                                
 
.PHONY : clean

clean :
	rm -rf  *.o *.d main $(all)
test_generic:
	./main -a generic -i ../test/test.bc -o ../test/results/test_generic_result
test_lazy:
	./main -a lazy -i ../test/test.bc -o ../test/results/test_lazy_result
test_hybrid:
	./main -a hybrid -i ../test/test.bc -o ../test/results/test_hybrid_result
neon_hybrid:
	time ./main -a hybrid -i ../test/neon-0.28.3.bc -o ../test/results/neon_result
emacs_hybrid:
	time ./main -a hybrid -i ../test/temacs.bc -o ../test/results/emacs_result
debug:
	gdb ./main
